fix: Stop repo collaborators drifting on owner#3471
Conversation
|
👋 Hi, and thank you for this contribution! This repo is maintained by GitHub and community members on a best-effort basis. We'll get to this as soon as we can. You can help us prioritize by joining the discussion on open issues and PRs, sharing details on the changes you need, and reviewing other contributions. 🤖 This is an automated message. |
There was a problem hiding this comment.
Pull request overview
These provider review instructions are being used.
This PR aims to eliminate perpetual drift in github_repository_collaborators for personal repositories by ignoring the implicit repository owner collaborator when the owner isn’t configured, and introduces an owner_configured computed attribute to track that behavior.
Changes:
- Adds an
owner_configuredcomputed attribute to thegithub_repository_collaboratorsschema and sets it during diffing. - Updates collaborator listing/reconciliation to optionally ignore the repository owner (to prevent owner-related drift on personal repos).
- Adds acceptance tests for the personal-repo owner drift scenarios and updates the generated docs schema output.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
github/resource_github_repository_collaborators.go |
Adds owner_configured and uses an ignore list to filter the owner from collaborator reads/updates to prevent drift. |
github/resource_github_repository_collaborators_test.go |
Adds acceptance coverage for personal repositories to validate owner drift behavior. |
docs/resources/repository_collaborators.md |
Documents the new owner_configured read-only attribute in the generated schema section. |
7b15eef to
0f445c8
Compare
4cbaf51 to
19a9c60
Compare
15bef2c to
93b66b9
Compare
robert-crandall
left a comment
There was a problem hiding this comment.
Thanks for tracking this one down @stevehipwell ! The state migration + NewValueKnown fallback is a really clean way to handle it.
|
@deiga just waiting on you for the merge. |
Signed-off-by: Steve Hipwell <steve.hipwell@gmail.com>
93b66b9 to
839ea7e
Compare
* fix: Stop repo collaborators drifting on owner Signed-off-by: Steve Hipwell <steve.hipwell@gmail.com> * fixup! fix: Stop repo collaborators drifting on owner * fixup! fix: Stop repo collaborators drifting on owner * fixup! fix: Stop repo collaborators drifting on owner --------- Signed-off-by: Steve Hipwell <steve.hipwell@gmail.com>
Resolves #3434
Before the change?
github_repository_collaboratorsresource drifts when the rpo is personally and the owner hasn't been configuredAfter the change?
github_repository_collaboratorsresource ignores the owner if no configuredowner_configuredcomputed attribute togithub_repository_collaboratorsresourcePull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!